#include "sqlite_db.h"
#include "sqlite3.h"
#include "define.h"
#include "zlog.h"

extern sqlite3* g_sqlite3_db;

int createAlarmTable()
{
	char *errMsg;
	int rc;
	if((rc = sqlite3_exec(g_sqlite3_db, createAlarmSql, 0, 0, &errMsg)) != SQLITE_OK)
	{
	        dzlog_error("sqlite3_exec createAlarmTable error :%s", errMsg);
	        return -1;
	}
	else
	{
	       dzlog_info("sqlite3_exec createAlarmTable succ :%s", errMsg);
	}

return 0;	
}

void test()
{
	char *errMsg;
	int rc;
	if((rc = sqlite3_exec(g_sqlite3_db, selectsql, 0, 0, &errMsg)) != SQLITE_OK)//查询
	{
	        printf("查询错误:%s\n", errMsg);
	}
	printf("插入操作=========================================\n");
	if((rc = sqlite3_exec(g_sqlite3_db, insertsql, 0, 0, &errMsg)) != SQLITE_OK)//删除
	{
	        printf("插入错误:%s\n", errMsg);
	}
	printf("删除操作=========================================\n");
	if((rc = sqlite3_exec(g_sqlite3_db, deletesql, 0, 0, &errMsg)) != SQLITE_OK)//删除
	{
	        printf("删除错误:%s\n", errMsg);
	}


}


